{{if !empty($_SESSION['Auth']['Staff']) }}
<div id="admin-tool-bar" style="position:fixed;top:60px;left:0px;width:150px;">
	<div class="panel panel-primary" style="border-radius: 0;">
	  <div class="panel-heading" style="border-radius: 0;">MiaoCMS<small>管理控制</small></div>
	  <div class="panel-body" style="padding:0;border-radius: 0;">
	    	<div class="list-group">
	    		<a href="#" id="ui-edit-layout" class="list-group-item-info list-group-item"><i class="glyphicon glyphicon-list-alt"></i> 编辑布局</a>
				<a href="#" onclick="add_layout_row();" class="list-group-item-info list-group-item"><i class="glyphicon glyphicon-indent-left"></i> 新增一行</a>
				<a href="#" class="list-group-item-warning list-group-item" onclick="saveTemplate();"><i class="glyphicon glyphicon-floppy-disk"></i> 保存模板</a>
				<a id="cms-admin-controls-toggle" href="#" class="list-group-item list-group-item-warning"><i class="glyphicon glyphicon-eye-open"></i> 编辑风格</a>
                <a href="?edit=1" class="list-group-item list-group-item-warning"><i class="glyphicon glyphicon-edit"></i> 编辑模板</a>
				<a class="list-group-item list-group-item-danger" href="#" onclick="return ajaxAction('{{Router::url('/manage/admin/tools/clearcache')}}');" ><i class="fa fa-trash"></i> {{lang('clear_cache')}}</a>
				<a class="list-group-item list-group-item-danger" target="_blank" href="{{Router::url('/manage/admin')}}" ><i class="fa fa-desktop"></i> {{lang('admin_pannel')}}</i></a>
			</div>
	  </div>
	</div>
	<a id="admin-toolbar-trigger" class="btn btn-warning" href="javascript:;" style="position:absolute;left:150px;top:0px;padding:6px;border-radius: 0;" ><small><span class="glyphicon glyphicon-asterisk"></span></small></a>
		
	
	<div id="ajaxestatus" style="line-height:32px;display:none;margin-top: 6px;width:100px;height:20px; background:url({{$this->Html->url('/img/pbar-ani.gif')}}) repeat-x 0 0;float:left;margin-left:5px;"></div>
</div>
	
<script type="text/javascript"> 
$(document).ready(function() {
	$('#admin-tool-bar').css('left','-150px');
	
	var expanded = true;
	
	$('#admin-toolbar-trigger').click(function(){
		if(expanded){
			$('#admin-tool-bar').animate({left:'0'},500);
		}else{
			$('#admin-tool-bar').animate({left:'-150px'},500);
		}
		expanded = !expanded;
	});
	
	$('#ui-edit-layout').click(function(){
		if($(this).hasClass('IsEditing')){			
			resetPortletLayout(); // 结束编辑
			$(this).removeClass('IsEditing');
			$(this).html('<i class="glyphicon glyphicon-list-alt"></i> 编辑布局');
			return false;
		}
		else{
			triggerPortletLayout(); // 开始编辑
			$(this).addClass('IsEditing');
			$(this).html('<i class="glyphicon glyphicon-list-alt"></i> 结束编辑');
			return false;
		}
	});
	//$('#ui-edit-layout').trigger('click');
});
</script>

<div id="ui-edit-point-modal" class="modal hide fade" >
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h3 id="myModalLabel">编辑提示</h3>
	</div>
	<div class="modal-body">
		<p>内部区域的内容(一般指插入的列表或者内容)可以跨内部区域移动</p>
		<p>内部区域不能跨外部区域移动，只能在同一外部区域内互换位置</p>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
	</div>
</div>

<div class="modal fade"  id="contain-column-edit-form" id="ColumnEditModal" tabindex="-1" role="dialog" aria-labelledby="ColumnEditModal" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">设置内容各列宽的比例，和为12</h4>
      </div>
      <div class="modal-body">
        <p class="validateTips">设置内容的比例，和为12.</p>
		<form>
		<span id="text-width-total"></span>-<span id="text-width-sub"></span>
		<fieldset>
			<div><label for="layout-first-width">第一列的宽度</label>
			<input type="text" id="layout-first-width" value="8" class="text ui-widget-content ui-corner-all" />
			</div><div><label for="layout-second-width">第二列的宽度</label>
			<input type="text" id="layout-second-width" value="4" class="text ui-widget-content ui-corner-all" />
			</div><div><label for="layout-third-width">第三列的宽度</label>
			<input type="text" id="layout-third-width" value="0" class="text ui-widget-content ui-corner-all" />
			</div><div><label for="layout-fourth-width">第四列的宽度</label>
			<input type="text" id="layout-fourth-width" value="0" class="text ui-widget-content ui-corner-all" />
			</div>
		</fieldset>
		</form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" id="comfirm-column-width" class="btn btn-primary">确定</button>
      </div>
    </div>
  </div>
</div>

	{{$this->Html->script(array('jquery/jquery.uitr.js',))}}
	<!-- /themeroller/themeroller.htm -->
	<script type="text/javascript">
	$(function(){
		$('#cms-admin-controls-toggle').click(function(){
			jquitr.addThemeRoller('{{Router::url("/manage/admin/stylevars/themeroller")}}');
			//jquitr.closeThemeRoller();
		});
	});
	</script>
	
{{/if}}
